import React, { useState } from 'react'
import { NavLink, Outlet } from 'react-router-dom'

export default function Message() {
    let [todo, setTodo] = useState({id:99,title:'test State'}) 
    return (
        <div>
            <ul>
                <li>
                    {/* 携带path参数 */}
                    <NavLink to='detail/1/params参数测试'>params参数</NavLink>&nbsp;&nbsp;
                </li>
                <li>
                    <NavLink to='search?id=2&title=query参数测试'>query参数</NavLink>&nbsp;&nbsp;
                </li>
                <li>
                    <NavLink to='state' state={todo}>state参数 1</NavLink>&nbsp;&nbsp;
                </li>
                <li>
                    <NavLink to='state' state={{id:88,title:'889900'}}>state参数 2</NavLink>&nbsp;&nbsp;
                </li>
            </ul>
            <div>
                <Outlet/>
            </div>
        </div>
    )
}
